package com.letoken.platform.pub.annotation.content;

import org.springframework.core.annotation.Order;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Date 2021/3/16 15:58
 * @Created GG
 * @Description
 */
@Target({FIELD})
@Retention(RUNTIME)
@Documented
@Order(10002)
@Constraint(validatedBy = {ContentValidator.class})
public @interface ContentCheck {
    // 枚举类型 文本或图片链接审核
    ContentEnum type() default ContentEnum.CONTENT;
    // 是否允许为空 当为null时不进行审核
    String allowNull() default "false";
    // 审核失败提示语
    String message() default  "审核不通过";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
